﻿<%@ Page Title="Вакансії" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Work.UI.Web.Forms.Admin.Vacancy.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentHeader" runat="server">
    Вакансії
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ObjectDataSource ID="odsVacancy" runat="server" OnObjectCreating="odsVacancy_ObjectCreating"
        TypeName="Work.BL.Hibernate.Managers.HVacancyManager" DataObjectTypeName="Work.BL.POCOs.VacancyPOCO"
        StartRowIndexParameterName="startIndex" MaximumRowsParameterName="maxCount" SelectCountMethod="GetVacancyCount"
        SelectMethod="GetVacancies" DeleteMethod="Delete" UpdateMethod="Block" EnablePaging="false">
        <DeleteParameters>
            <asp:Parameter Name="Id" Type="Int32" />
        </DeleteParameters>
    </asp:ObjectDataSource>
    <asp:GridView ID="grvVacancy" runat="server" DataSourceID="odsVacancy" AutoGenerateColumns="false"
        AllowPaging="true" PageSize="20" AllowSorting="true" CssClass="GridViewStyle"
        DataKeyNames="Id" OnRowDeleted="grvVacancy_OnRowDeleted">
        <FooterStyle CssClass="GridViewFooterStyle" />
        <RowStyle CssClass="GridViewRowStyle" />
        <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
        <PagerStyle CssClass="GridViewPagerStyle" />
        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
        <HeaderStyle CssClass="GridViewHeaderStyle" />
        <Columns>
            <asp:TemplateField HeaderText="#">
                <ItemTemplate>
                    <%# Eval("Id") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Title">
                <ItemTemplate>
                    <%# Eval("Title")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Date">
                <ItemTemplate>
                    <%# Eval("Date")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Salary">
                <ItemTemplate>
                    <%# Eval("Salary")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Is Visible">
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("IsVisible") %>' Enabled="false" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Is Subscribe">
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Eval("IsSubScribe") %>'
                        Enabled="false" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Is Blocked">
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("IsBlocked") %>' Enabled="false" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <asp:LinkButton ID="lnkbtnUpdate" runat="server" Text="Block" CommandName="Update" />
                    &nbsp;|&nbsp;
                    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# "~/Admin/Vacancy/Details.aspx?Id=" + Eval("Id") %>'>
                    Details
                    </asp:HyperLink>
                    &nbsp;|&nbsp;
                    <asp:LinkButton runat="server" ID="LinkButton1" CommandName="Delete" OnClientClick="return confirm('Are you certain you want to delete this vacancy?');">
                    Delete</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
